home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 April / Macworld (1999-04).dmg / Shareware World / Comms & Internet / PageSpinner 2.1 / PageSpinner 2.1 68K / Includes / ps_rollover.js next >
Text File  |  1998-11-22  |  2KB  |  85 lines

  1. <SCRIPT LANGUAGE="JavaScript">
  2. <!--
  3. function psHover(ignored) {}
  4. function psNormal(ignored){}
  5. function psClick(ignored){}
  6. // -->
  7. </SCRIPT>
  8.  
  9. <SCRIPT LANGUAGE="JavaScript1.1">
  10. <!--
  11. // Generated by PageSpinner, www.optima-system.com
  12. gNumImages = 0;
  13. var lastButton="";
  14. function psHover(bName) 
  15. {
  16.     if (document.images) 
  17.     {
  18.         if (lastButton != "")
  19.             psNormal(lastButton);
  20.  
  21.         lastButton=bName;
  22.         if (!document.images[bName])
  23.             return false;
  24.  
  25.         document.images[bName].src = hoverSrc[bName];
  26.         if (clickSrc[bName])
  27.         {
  28.             tmpImage = new Image();
  29.             tmpImage.src = clickSrc[bName];
  30.             delete tmpImage;
  31.         }
  32.         if (imgStatusText[bName] != "")
  33.         { self.status = imgStatusText[bName]; return true; }
  34.     }
  35.     return false;
  36. }
  37.  
  38. function psClick(bName) 
  39. {
  40.     if (document.images) 
  41.     {
  42.         lastButton=bName;
  43.         if (!document.images[bName] || clickSrc[bName]=="")
  44.             return true;
  45.  
  46.         document.images[bName].src = clickSrc[bName];
  47.     }
  48.     return true;
  49. }
  50.  
  51. function psNormal(bName)
  52. {
  53.     if(document.images && bName != "")
  54.     {
  55.         if (document.images[bName])
  56.             document.images[bName].src = normalSrc[bName];
  57.  
  58.         if (imgStatusText[bName] != "")
  59.         {    self.status = ""; return true; }
  60.     }
  61.     return false;
  62. }
  63.  
  64. function psRegImages(bName, normalSource, hoverSource, clickSource, width, height, statusText)
  65. {
  66.     if (document.images) 
  67.     {
  68.         gNumImages++;
  69.         normalSrc[bName] = normalSource;
  70.         hoverSrc[bName] = hoverSource;
  71.         clickSrc[bName] = clickSource;
  72.         imgStatusText[bName] = statusText;
  73.     }
  74. }
  75.  
  76. if (document.images)
  77. {
  78.     hoverSrc    =    new Array(gNumImages);
  79.     normalSrc    =    new Array(gNumImages);
  80.     clickSrc    =    new Array(gNumImages);
  81.     imgStatusText = new Array (gNumImages);
  82. }
  83. // -->
  84. </SCRIPT>
  85.